/*
 * File Name：TrackMove.java
 * Copyright：Copyright 2008-2012 CiWong.Inc. All Rights Reserved.
 * Description： TrackMove.java
 * Modify By：PLA-ZJLIU
 * Modify Date：2012-12-12
 * Modify Type：Add
 */
package com.ciwong.ciwongwrite.mode;

import android.graphics.Canvas;

/**
 *
 * @author PLA-ZJLIU
 * @version ciwong v.1.0 2012-12-12
 * @since ciwong v.1.0
 */
public abstract class TrackMove extends TrackBase
{
    /**
     * 是否是录制
     */
    protected boolean isRecord;

    /**
     * 画笔颜色
     */
    protected int color;

    /**
     * 画笔宽度
     */
    protected float width;


    /**
     * 绘图
     *
     * @param mCanvas
     *            画布
     */
    public abstract void draw(Canvas mCanvas);

    /**
     * 移动
     *
     * @param x
     *            x坐标
     * @param y
     *            y坐标
     */
    public abstract void move(float x, float y);

    /**
     * UP手势
     *
     * @param mCanvas
     *            Canvas
     */
    public abstract void touchUp(Canvas mCanvas);

    /**
     *
     * Down手势
     *
     * @param mCanvas
     *            Canvas
     */
    public abstract void touchDown(Canvas mCanvas, float x, float y);

    /**
     * 将动作格式化
     *
     * @param touchDown
     *            手指是否按下
     * @return 格式化的字符串
     */
    public abstract String format(boolean touchDown);

    /**
     * 设置是否为录制状态
     *
     */
    public void setRecord()
    {
        isRecord = true;
    }

    /**
     * 颜色
     *
     * @param color
     *            颜色
     */
    public void setColor(int color)
    {
        this.color = color;
    }

    /**
     * 画笔宽度
     *
     * @param width
     *            画笔宽度
     */
    public void setWidth(int width)
    {
        this.width = width;
    }

    public static abstract class MoveMode
    {
        /**
         * MotionEvent.ACTION_DOWN
         */
        public static final int MOUSE_DOWN = 1;

        /**
         * MotionEvent.ACTION_UP
         */
        public static final int MOUSE_UP = 0;

        /**
         * MotionEvent.MOUSE_NONE
         */
        public static final int MOUSE_NONE = -1;

        public int mouseDown;

        public float x;

        public float y;
    }
}
